local skel = fk.CreateSkill {
  name = "emo__jingbu",
  tags = {Skill.Compulsory},
}

skel:addEffect(fk.CardUsing, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(skel.name) and player == target and player.phase ~= Player.NotActive
    and player:getMark("emo__jingbu_me-turn") == 0
  end,
  on_use = function(self, event, target, player, data)
    data.disresponsiveList = player.room:getAlivePlayers(false)
  end,
})

skel:addEffect(fk.CardUsing, {
  anim_type = "offensive",
  can_refresh = function (self, event, target, player, data)
    if player:hasSkill(skel.name, true) and target.phase ~= Player.NotActive then
      if target == player then
        return data.card.type == Card.TypeEquip and player:getMark("emo__jingbu_me-turn") == 0
      else
        return data.card.type ~= Card.TypeEquip and target:getMark("emo__jingbu_other-turn") == 0
      end
    end
  end,
  on_refresh = function (self, event, target, player, data)
    local room = player.room
    if target == player then
      room:setPlayerMark(player, "emo__jingbu_me-turn", 1)
    else
      room:setPlayerMark(target, "emo__jingbu_other-turn", 1)
    end
  end,
})

skel:addEffect("prohibit", {
  is_prohibited = function(self, from, to, card)
    return from and from.phase ~= Player.NotActive and from:getMark("emo__jingbu_other-turn") == 0
    and card and card.type ~= Card.TypeEquip
    and to and to:hasSkill(skel.name) and from ~= to
  end,
})

skel:addEffect("maxcards", {
  correct_func = function(self, player)
    if player:hasSkill(skel.name) and player.phase ~= Player.NotActive and player:getMark("emo__jingbu_me-turn") == 0 then
      return 3
    end
  end,
})

skel:addEffect("targetmod", {
  bypass_distances = function (self, player, skill, card)
    return card and player:hasSkill(skel.name) and player.phase ~= Player.NotActive and player:getMark("emo__jingbu_me-turn") == 0
  end,
  bypass_times = function (self, player, skill, scope, card, to)
    return card and player:hasSkill(skel.name) and player.phase ~= Player.NotActive and player:getMark("emo__jingbu_me-turn") == 0
  end,
})

Fk:loadTranslationTable{
  ["emo__jingbu"] = "静步",
  [":emo__jingbu"] = "锁定技，你的回合内，若你本回合未使用装备牌，你手牌上限+3，使用牌无次数距离限制且不可被响应。其他角色于其回合内使用的第一张非装备牌无法指定你为目标。",
}


return skel
